﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Common;
using WFNetLib;

namespace 生命体征测试仪
{
    public partial class formMaintenance : formBase
    {
        public formMaintenance(Form f)
        {
            InitializeComponent();
            mainForm = f;
            ids = new string[3];
            ids[0] = "230105198002281018";
            ids[1] = "230102196502244610";
            ids[2] = "230502196507060513";
        }
        Form mainForm;

        private void skinButton6_Click(object sender, EventArgs e)
        {
            formWorkLogin f = new formWorkLogin();
            if (f.ShowDialog() == DialogResult.OK)
            {
                if (f.tbName.Text == "8888" && f.tbPass.Text == "123456")
                {
                    formLevel1 f1 = new formLevel1(mainForm);
                    f1.ShowDialog();
                }
            }
        }
        string[] ids;
        private void skinButton1_Click(object sender, EventArgs e)
        {
            formGetID f = new formGetID();
            f.ShowDialog();
            if (f.bIDOk)
            {
                for (int i = 0; i < 3; i++)
                {
                    if (formMain.curUser.ID == ids[i])
                    {
                        formDeviceSet ff = new formDeviceSet();
                        ff.ShowDialog();
                        return;
                    }
                }
                RegResult ret = WebWork.CheckRecord(formMain.curUser.ID);
                if (ret != null && ret.message == "ok")
                {
                    MessageBox.Show("巡检登记成功");
                }
                else
                {
                    MessageBox.Show("巡检登记失败");
                }
            }
            try
            {
                string stmp = System.Windows.Forms.Application.StartupPath + "\\身份证照片";
                string file = stmp + "\\" + formMain.curUser.ID + ".bmp";
                FileOP.Delete(file, FileOPMethod.File);
                file = stmp + "\\" + formMain.curUser.ID + ".jpg";
                FileOP.Delete(file, FileOPMethod.File);
            }
            catch //(System.Exception ex)
            {

            }
        }
    }
}
